package com.weixin.dao;

import com.weixin.bean.SendMessageBean;
import com.weixin.bean.SendMsgDto;
import org.apache.ibatis.annotations.*;

import java.util.List;

import static sun.java2d.cmm.ColorTransform.In;

/**
 * Created by Administrator on 2018-01-24.
 */
@Mapper
public interface ISendMessageDao {

    @Select("SELECT * FROM sendMessageKey WHERE status = 1")
    @Results(value = {
            @Result(property = "fromMessageType", column = "FmsgType"),
            @Result(property = "toMessageType", column = "TmsgType")
    })
    List<SendMessageBean> getAllKey();

    @Update("UPDATE sendMessageKey SET count= #{count} WHERE id= #{id}")
    void addCount (SendMessageBean bean);

    @Insert("INSERT INTO sendMsgDetail(sMsgKeyId,messageId,createTime,userName) VALUES(#{id},#{messageId},#{createTime},#{userName})")
    void InsertSendDetail (SendMsgDto dto);
}
